<?php

// delete from articles where id=1


include_once("../conn.php");

$id = $_GET['id'];

$sql = "delete from articles where id=:id";

$stmt = $conn->prepare($sql);
$stmt->bindParam(":id", $id);
$stmt->execute();

if($stmt->rowCount()>0){
	// 删除完毕后 跳转到列表
	header("location: list.php");
} else {
	echo "文章不存在";
}

